
//load function after whole page is loaded
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}



addLoadEvent(function() {
    var oElement = document.getElementById("view2_12863731_back_1");
    function fnCallback(e) {


        var el = Utils.EventHelper.getElementsByClassName(oElement,"div","buttonAppearance")[0];
        
        if (el.pressed) {
            swapButton("remove",el);
            el.pressed = false;
        }
        else {
            el.pressed = true;
            swapButton("add",el);
        }
    }
    YAHOO.util.Event.addListener(oElement, "click", fnCallback);
})


function swapButton(action, obj) {
    switch (action){
			case 'add':
				obj.className=obj.className + ' ' + 'pressed';
			break;
            case 'remove':
				obj.className=obj.className.replace('pressed','');
			break;
    }
}